// 初始化按钮状态

export default function updateButtonStatus(page = 'main') {
    if (page === 'main') {
        const {orgVal, pageInfo} = this.state;
        const flag = !parseInt(pageInfo.total);
        this.props.button.setButtonVisible({
            Query: true,
            Sort: true,
            export: true,
            ExportPsnInfo: true,
            ExportPsnInfoAll: true,
            ListReport: true,
            Return: false,
            First: false,
            Pre: false,
            Next: false,
            Last: false
        });
        this.props.button.setButtonDisabled({
            Query: !orgVal.refpk,
            Refresh: !orgVal.refpk,
            //MoreOp: flag,
            Sort: flag,
            File: flag,
            //assqry: flag,
            ExportPhoto: flag,
            ListReport: flag,
            JobHis: flag,
            ReptObj: flag,
            export: flag,
            ExportPsnInfo: flag,
            ExportPsnInfoAll: flag,
            Print: flag,
            output: flag,
            TempPrint: flag
        });
    } else {
        this.props.button.setButtonVisible({
            Query: false,
            Sort: false,
            ExportPsnInfo: false,
            ExportPsnInfoAll: false,
            ListReport: false,
            Return: false,
            First: false,
            Pre: false,
            Next: false,
            Last: false
        });
        this.props.button.setButtonDisabled({
            Refresh: false,
            MoreOp: false,
            File: false,
            assqry: false,
            ExportPhoto: false,
            JobHis: false,
            ReptObj: false,
            Print: false,
            output: false,
            TempPrint: false
        });
    }
}
